﻿#region License
/* ---------------------------------------------------------------- *
 *
 * This file is part of the API Concepts Framework
 * http://apiconceptsframework.codeplex.com
 *
 * Copyright (C) 2014 eva Kühn, Thomas Scheller, Vienna University of Technology
 * http://www.complang.tuwien.ac.at/eva
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/
 *
 * ---------------------------------------------------------------- */
#endregion

using ApiConceptsFramework.HCs;

namespace ApiConceptsFramework.FluentApi
{
	/// <summary>
	/// Extension methods for the high-level concept config string.
	/// </summary>
	public static class ConfigStringExtensions
	{
		/// <summary>
		/// Defines that a certain configuration string is used.
		/// </summary>
		/// <param name="eval">The ApiEvaluator instance.</param>
		/// <param name="configString">The configuration string that is used.</param>
		/// <param name="numberOfUsages">The number of usages (default = 1).</param>
		/// <param name="previousUsages">The number of previous usages (default = 0), used for calculating the learning effect.</param>
		public static void ConfigString(this ApiEvaluator eval, string configString, int numberOfUsages = 1, int previousUsages = 0)
		{
			var pd = eval.GetOrCreateHcInputData<ConfigStringInputData>();
			pd.ConfigStrings.Add(new ConfigStringValue
				{
					ConfigString = configString,
					NumberOfUsages = numberOfUsages,
					PreviousUsages = previousUsages
				});
		}
	}
}